package com.zb.sinocare.baobiaogl.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@Configuration

public class SwaggerConfig {
    @Bean
    public Docket docket(){
        //创建一个Docke对象
        Docket docket = new Docket(DocumentationType.SWAGGER_2);
        //创建Api接口信息对象
        ApiInfo apiInfo = new ApiInfoBuilder()
                .title("Swagger[Api接口文档]")//标题
                .description("描述文字")//描述
                .contact(new Contact("锜哥","http://","5646465@qq.com"))//联系方式
                .version("1.0")//版本号
                .build();
        //指定docket的ApiInfo
        docket.apiInfo(apiInfo);
        return  docket;
    }
}
